package com.yingjie.addressbook;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class SmsActivity extends Activity {
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sms);
        BindSms(0);
	}
	
    public void BindSms(int iType){
    	ArrayList<HashMap<String,Object>> list = Sms.getSms(this);
        SimpleAdapter  adapter = new SimpleAdapter (this,list,R.layout.sms_list_row,new String[]{"Number","Name","Type","Time","Body"} ,new int[]{R.id.itemSmsNumeber,R.id.itemSmsName,R.id.itemSmsType,R.id.itemSmsTime,R.id.itemSmsBody});
        ListView lv = (ListView)findViewById(R.id.lvSms);
        lv.setAdapter(adapter);
    }
}
